#!/usr/bin python3
# -*- coding:UTF-8 -*-
# Author: nigo
import subprocess

# subprocess.run(['dir', '-a']) # windows 环境下查看当前目录文件


def md2pdf(mdname, pdfname):
    mainfont = "mainfont=WenQuanYi Micro Hei Mono" # 字体
    cmd = [
        'pandoc', mdname, '--pdf-engine=xelatex', '-o', pdfname, '-V',
        mainfont, '--toc'
    ] # 终端命令组成列表
    subprocess.run(cmd) # 调用终端命令


if __name__ == '__main__':
    md2pdf('2021-03-05.md', '2021-03-05.pdf')
